import { useRoute, useRouter } from 'vue-router';
export const useRouterApi = ({ backQuery }) => {
    const route = useRoute();
    const router = useRouter();
    const handleBack = () => {
        // 判断是否可以回退
        if (window.history.length > 1) {
            router.go(-1); // 返回上一个界面
        } else {
            router.push(backQuery);
        }
    };
    return {
        route,
        router,
        handleBack
    };
};